<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- <meta http-equiv="refresh" content="10"> -->
<title>美丽敲敲门大地图</title>
<style type="text/css">
html {
	height: 100%
}

body {
	height: 100%;
	margin: 0px;
	padding: 0px
}

#container {
	height: 100%
}
</style>
<script type="text/javascript"
	src="http://api.map.baidu.com/api?v=2.0&ak=DDbl4GuGNmDrLbKeaDsCzAeDfOGhdyET">
	//v2.0版本的引用方式：src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"
	//v1.4版本及以前版本的引用方式：src="http://api.map.baidu.com/api?v=1.4&key=您的密钥&callback=initialize"
</script>
</head>
<script language="javascript">
	var XMLHttpReq;
	//创建XMLHttpRequest对象         
	function createXMLHttpRequest() {
		if (window.XMLHttpRequest) { //Mozilla 浏览器  
			XMLHttpReq = new XMLHttpRequest();
		} else if (window.ActiveXObject) { // IE浏览器  
			try {
				XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
				}
			}
		}
	}
</script>
<body>
	<div id="container"></div>
	<script type="text/javascript">
		var map = new BMap.Map("container"); // 创建地图实例  
		map.enableScrollWheelZoom(); //启用滚轮放大缩小，默认禁用
		map.enableContinuousZoom(); //启用地图惯性拖拽，默认禁用
		var point = new BMap.Point(115.851808, 28.694773); // 创建点坐标  
		var point2 = new BMap.Point(115.86999, 28.687675);
		map.centerAndZoom(point, 15); // 初始化地图，设置中心点坐标和地图级别

		//放缩控件
		/* var opts = {
			type : BMAP_NAVIGATION_CONTROL_SMALL
		}
		map.addControl(new BMap.NavigationControl(opts)); */

		//系统图标遮盖
		var marker = new BMap.Marker(point); // 创建标注    
		map.addOverlay(marker); // 将标注添加到地图中

		//创建小狐狸
		var pt = new BMap.Point(115.86999, 28.687675);
		var myIcon = new BMap.Icon(
				"http://developer.baidu.com/map/jsdemo/img/fox.gif",
				new BMap.Size(200, 157));
		var marker2 = new BMap.Marker(pt, {
			icon : myIcon
		}); // 创建标注
		var label = new BMap.Label("我是文字标注哦", {
			offset : new BMap.Size(5, 5)
		});
		marker2.setLabel(label);
		map.addOverlay(marker2); // 将标注添加到地图中

		 map.centerAndZoom(new BMap.Point(115.851808, 28.694773), 14);
		var driving = new BMap.DrivingRoute(map, {
			renderOptions : {
				map : map,
				autoViewport : true
			}
		});
		driving.search("金久国际大厦停车场(西出入口)", "八一广场"); 
		
		map.centerAndZoom(new BMap.Point(115.851808, 28.694773), 14);
		var transit = new BMap.TransitRoute(map, {    
			 renderOptions: {map: map}    
			});  
		transit.search("金久国际大厦停车场(西出入口)", "八一广场");
	</script>
</body>
</html>